import React from 'react';


import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom';

import Home from '../src/pages/Home';
import CityList from '../src/pages/CityList';
import MapPage from './pages/Map';


export default class App extends React.Component {

  render() {
    return (

      <Router>
        <div className='app'>
          {/* 设置默认跳转home页面 */}
          <Route path='/' exact render={() => <Redirect to='/home' />}></Route>
          {/* <Route path='/' exact component={Home}></Route> */}
          <Route path='/home' component={Home}></Route>
          <Route path='/citylist' component={CityList}></Route>
          <Route path='/map' component={MapPage}></Route>
        </div>
      </Router>
    )
  }
}
